package pl.PawelAndAlicja.badugiproject.main.Cards;

/**
 * Created by Pawel on 2014-11-16.
 */
public class Hand {
    public Hand(HandMasterMain father) {
        this.mainDeck = father;
        this.factoryCard = new FlyweightFactoryCard();
        this.hand = new ClientDeck(factoryCard);

        // Pobranie losowej reki z glownej talii
        this.hand = mainDeck.getHandFromMaster();
    }

    public void showHand() {
        this.hand.showDeck();
    }

    public ClientDeck getHand() {
        return hand;
    }

    public void setHand(ClientDeck clientDeck) {
        this.hand = clientDeck;
    }

    public static void main(String[] args) {
        FlyweightFactoryCard flyweightFactoryCard = new FlyweightFactoryCard();
        HandMasterMain handMasterMain = new HandMasterMain(flyweightFactoryCard);

        Hand hand1 = new Hand(handMasterMain);
        Hand hand2 = new Hand(handMasterMain);
//        Hand hand3 = new Hand(handMasterMain);
      //  Hand hand4 = new Hand(handMasterMain);
     //   Hand hand5 = new Hand(handMasterMain);
     //  Hand hand6 = new Hand(handMasterMain);


        System.out.println("Glowna talia: ");
        handMasterMain.showDeck();
        System.out.println("\nReka 1: ");
        hand1.showHand();
        System.out.println("\nReka 2: ");
        hand2.showHand();
//        System.out.println("\nReka 3: ");
//        hand3.showHand();
//        System.out.println("\nReka 4: ");
//        hand4.showHand();
//        System.out.println("\nReka 5: ");
//        hand5.showHand();
//        System.out.println("\nReka 6: ");
//        hand6.showHand();

    }

    private ClientDeck hand;              // ręka gracza
    private FlyweightFactoryCard factoryCard;
    private HandMasterMain mainDeck;
}
